//
//  PostWorkManButtonCell.m
//  operativeSide
//
//  Created by 王春程 on 16/6/6.
//  Copyright © 2016年 com.caocaod.www. All rights reserved.
//

#import "PostWorkManButtonCell.h"
#import <ReactiveObjC/ReactiveObjC.h>

@interface PostWorkManButtonCell()
@property (strong, nonatomic)                   UIButton *button;

@end
@implementation PostWorkManButtonCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initSubView];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = RGB(232, 232, 232);
    }
    return self;
}

- (void)initSubView {
    _button = [UIButton buttonWithType:UIButtonTypeCustom];
    _button.layer.cornerRadius = 3;
    _button.layer.masksToBounds = YES;
    _button.backgroundColor = RGB(253, 214, 47);
    [_button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [_button setTitle:@"扫码取件" forState:UIControlStateNormal];
    [_button setTitleColor:RGB(51, 51, 51) forState:UIControlStateNormal];
    _button.frame = CGRectMake(17, 10, VIEW_WIDTH - 34, 48);
    _button.titleLabel.font = [UIFont systemFontOfSize:17.0];
    [self.contentView addSubview:self.button];
    [[self.button rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
        [[NSNotificationCenter defaultCenter] postNotificationName:@"postWorkmanScan" object:nil];
    }];
}


@end
